﻿namespace FiftyOne.Foundation.Mobile.Detection.Wurfl.Handlers
{
    using System;

    internal class AndriodHandler : RegexSegmentHandler
    {
        private const byte EXTRA_CONFIDENCE = 1;
        private static readonly string[] PATTERNS = new string[] { @"(?<=Mozilla/\d.\d \()[^)]+", @"Android [\d.]+" };

        internal AndriodHandler() : base(PATTERNS, new int[] { 3, 1 })
        {
            base._firstMatchOnly = true;
        }

        protected internal override bool CanHandle(string userAgent)
        {
            return (userAgent.Contains("Android") && base.CanHandle(userAgent));
        }

        internal override byte Confidence
        {
            get
            {
                return (byte) (base.Confidence + 1);
            }
        }
    }
}

